********************************************************************************
* DESCRIPTION: Function to define time stamp file name extension.
*
* INPUTS:      - None.
*
* OUTPUTS:     - Loaded data in memory.
*
********************************************************************************
********************************************************************************
* MAIN CODE
********************************************************************************
*** define random file name extension
clear
set obs 1
local ext_exists = 1
while `ext_exists' {
	global ext = clock("${S_DATE} ${S_TIME}", "DMYhms")/10^3 // create string of digits representing the date and time (year/month/day/hour/minute/second), to be used as file extension
	*global ext = 1966150468
	cap confirm file "${TEMP_DIR}/temp_ext_${ext}.dta"
	local ext_exists = !_rc
	sleep 1000
}
disp "--> time stamp file name extension = ${ext}"
save "${TEMP_DIR}/temp_ext_${ext}.dta", emptyok replace
clear




********************************************************************************
* RETURNING TO MAIN CODE
********************************************************************************
